'''
Description: 
Version: 1.0.1
Autor: hrlu.cn
Date: 2022-07-19 14:41:19
LastEditors: hrlu.cn
LastEditTime: 2022-09-17 18:13:52
'''
from monitor import urls


def set_indexes(request):
    path = request.path
    current = {}

    for p in urls.indexes:
        if p['url'] == path:
            current = p
        
        for s in p['subs']:
            if s['url'] == path:
                current = s
                current['parent'] = p['name']

    return {
        'indexes': urls.indexes,
        'current': current,
    }